﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ESS_IntegrateProject.aspx.cs" Inherits="KPIS.GERP.GFMS.APP.App_UI.Forms.ESS_IntegrateProject" %>

<%@ Register src="../UserControls/BGM_ProjectOperation.ascx" tagname="BGM_ProjectOperation" tagprefix="uc1" %>

<asp:Content ID="Content2" runat="server" contentplaceholderid="head">
    <title>ข้อมูลโครงการบูรณาการ</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="../Scripts/Common.js" type="text/jscript"></script>
    <script language="JavaScript" src="../Scripts/DatePicker.js" type="text/jscript"></script>
</asp:Content>

<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function UpdateItemCountField (sender, args)
            {
                //set the footer text
                sender.get_dropDownElement().lastChild.innerHTML= "รวมทั้งหมด " + sender.get_items().get_count() + " รายการ";
            }
        </script>
    </telerik:RadCodeBlock>
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
        Transparency="100" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    
    <div style="padding-top: 5px">
        <div class="moduleContent1000">
            <div class="moduleDivBottom1000">
                <asp:Panel ID="Panel1" runat="server">
                    <ul class="formList" style="width: 900px">
                        <li class="lastListItem">
                            <table width="900px">
                                <tr>
                                    <td width="150px" class="TextHeaderSmall" align="right">
                                        ปีงบประมาณ :
                                    </td>
                                    <td>
                                        <telerik:RadNumericTextBox ID="txtBgmYear" runat="server"
                                            Width="100px" ShowSpinButtons="True" 
                                            NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" />
                                    </td>
                                </tr>
                            </table>
                        </li>
                        <li class="lastListItem">
                            <table width="900px">
                                <tr>
                                    <td width="150px" class="TextHeaderSmall" align="right">
                                        โครงการบูรณาการ :
                                    </td>
                                    <td>
                                        <telerik:RadComboBox runat="server" ID="ddlBgmOptionSeq"
                                            Height="200px" Width="740px" Filter="Contains"
                                            OnSelectedIndexChanged="ddlBgmOptionSeq_SelectedIndexChanged"
                                            CausesValidation="false" AutoPostBack="true"
                                            EnableLoadOnDemand="true" 
                                            HighlightTemplatedItems="true"
                                            OnClientItemsRequested="UpdateItemCountField" 
                                            OnDataBound="ddlBgmOptionSeq_DataBound" 
                                            OnItemDataBound="ddlBgmOptionSeq_ItemDataBound">
                                            <HeaderTemplate>
                                                <ul>
                                                    <li class="ColumnHeader" style="text-align: left; width: 700px">
                                                        <table width="100%">
                                                            <tr>
                                                                <td>
                                                                    โครงการบูรณาการ
                                                                </td>
                                                                <td width="100px" align="right">
                                                                    คงเหลือ(บาท)
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </li>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <ul>
                                                    <li class="Column" style="text-align: left; width: 700px">
                                                        <table width="100%">
                                                            <tr>
                                                                <td>
                                                                    <%# DataBinder.Eval(Container.DataItem, "bgm_option_text")%>
                                                                </td>
                                                                <td width="100px" align="right" style="border-left-style: dotted; border-left-width: thin; border-left-color: #999999">
                                                                    <%# DataBinder.Eval(Container.DataItem, "remain_amount") %>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </li>
                                                </ul>
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                รวมทั้งหมด <asp:Literal runat="server" ID="RadComboItemsCount" /> รายการ
                                            </FooterTemplate>
                                        </telerik:RadComboBox>
                                        <asp:Label ID="lblError" runat="server" ForeColor="Red" />
                                    </td>
                                </tr>
                            </table>
                        </li>
                        <asp:Panel ID="Panel2" runat="server" Width="950px" CssClass="contentPanelMarginBottom5px"
                            Height="480px" ScrollBars="Auto">
                        <asp:Repeater ID="Reperter1" runat="server"
                            OnItemCommand="Reperter1_ItemCommand" 
                            OnItemDataBound="Reperter1_ItemDataBound" >
                            <HeaderTemplate>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <li class="dotListItem">
                                    <table width="900px">
                                        <tr>
                                            <td align="right" width="30px" class="controls_AlignLeft">
                                                <asp:ImageButton ID="cmdDown" runat="server" ImageUrl="~/App_UI/Images/PageViews/DownArrow.png" CommandName="Down" />
                                                <asp:ImageButton ID="cmdUp" runat="server" ImageUrl="~/App_UI/Images/PageViews/UpArrow.png" CommandName="Up" Visible="false" />
                                            </td>
                                            <td class="controls_Left" style="font-weight: bold">
                                                <%# Eval("bgm_proj_oper_name")%>
                                            </td>
                                            <td class="controls_Left" width="100px">
                                                <%# Eval("record_status_name")%>
                                            </td>
                                            <td width="70px" align="center">
                                                <asp:Label ID="lblBgmProjOperSeq" runat="server" Visible="false" Text='<%# Eval("bgm_proj_oper_seq")%>' />
                                                <asp:Label ID="lblRecordStatus" runat="server" Visible="false" Text='<%# Eval("record_status")%>' />
                                                <asp:LinkButton ID="cmdApprove" runat="server" CssClass="LinkButton" CommandName="Approve">
                                                    อนุมัติรายการ
                                                </asp:LinkButton>
                                                <asp:LinkButton ID="cmdClose" runat="server" CssClass="LinkButtonRed" CommandName="Close" Visible="false">
                                                    ปิดโครงการ
                                                </asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                    <table>
                                        <tr>
                                            <td width="25px" class="controls">
                                            </td>
                                            <td>
                                                <uc1:BGM_ProjectOperation ID="BGM_ProjectOperation1" runat="server" Visible="false" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                            </ItemTemplate>
                        </asp:Repeater>
                        </asp:Panel>
                    </ul>
                </asp:Panel>
            </div>
        </div>
    </div>
</asp:Content>